import { reqGetAddress, reqGetTradeList } from "@/api";

const state = {
    address: [],
    tradeList: {}
}
const mutations = {
    GETADDRESS(state, address) {
        state.address = address
    },
    GETTRADELIST(state, tradeList) {
        state.tradeList = tradeList
    },

}
const actions = {
    async getAddress({ commit }) {
        let res = await reqGetAddress()
        if (res.code == 200) {
            commit('GETADDRESS', res.data)
        }
    },
    async getTradeList({ commit }) {
        let res = await reqGetTradeList()
        if (res.code == 200) {
            commit('GETTRADELIST', res.data)
        }
    }
}
const getters = {}
export default {
    state,
    mutations,
    actions,
    getters
}